Get any data you can that gives measurements of winds when the storm made landfall (use the landfall listed for the storm in the table– often, there are more than one for a storm for different locations, but just try for the listed one).
A measure of how strong winds were over land around where the storm made landfall
BA: It may work, for daily wind speeds, to use the Global Historical Climatology Network Daily data. If you have monitor ids, you can use the meteo_pull_monitors function from rnoaa to pull data from this source. If you have the FIPS code for a county, you can use the function fips_stations in countyweather (a package Rachel is developing) to get the station IDs for all relevant stations in a county.
CP: I had issues running install_github("ropenscilabs/rnoaa") in order to use the function meteo_pull_monitors, so instead try load_all(). Note that this will only work if you have devtools installed and you have forked the rnoaa respository from Github.
For example, the FIPS for Miami-Dade is 12086. Based on the README file for this data, some of the windspeed variables have the abbreviations: “AWND”, “WSFG”, “WSF1”. You can therefore run:
# library(devtools)
# install_github("ropenscilabs/rnoaa", dependencies=TRUE) # if you need to install the package
# install_github("leighseverson/countyweather") # if you need to install the package
library(rnoaa)
library(countyweather)
miami_stations <- fips_stations("12086", date_min = "1992-08-01",
date_max = "1992-09-01")
miami_stations
## [1] "USC00083909" "USC00084095" "USC00087020" "USC00087760" "USC00088780"
## [6] "USR0000FTEN" "USW00012839" "USW00012859" "USW00092811"
This does not pull any weather stations. However, I know that the station “USW00012839” should exist for this time– it’s the Miami Intl Airport station. I wonder why this isn’t picked up by fips_stations?
Once you know the station number, you can run:
miami_wind <- meteo_pull_monitors("USW00012839", date_min = "1992-08-01",
date_max = "1992-09-01",
var = c("AWND", "WSFG", "WSF1")) %>%
mutate(wsfg = wsfg / 10) # Convert to m / s-- see the README for this data from link
head(miami_wind)
## Source: local data frame [6 x 5]
##
## id date awnd wsf1 wsfg
## (chr) (date) (int) (int) (dbl)
## 1 USW00012839 1992-08-02 38 67 9.8
## 2 USW00012839 1992-08-03 27 94 12.9
## 3 USW00012839 1992-08-04 34 76 9.8
## 4 USW00012839 1992-08-05 33 54 7.7
## 5 USW00012839 1992-08-06 33 98 11.3
## 6 USW00012839 1992-08-07 48 80 10.3
ggplot(miami_wind, aes(x = date, y = wsfg)) +
geom_line() + ggtitle("Wind gust speeds near Miami, FL, \nduring Hurricane Andrew") +
ylab("Wind gust (m / s)")

It seems like we should be able to get wind data from some of the other NOAA data sources. In particular, it seems like we should be able to get hourly, or another fine temporal resolution, of wind data. Check the “Data sources” section of the file at the bottom of the page here.
RS: The isd() function from the rnoaa package looks like it’s getting hourly data. Here’s an example with the station at Miami International Airport.
CP: A current issue is that the isd() function takes USAF and WBAN station codes as input, whereas we would like to use FIPS codes (county codes) as input. My initial thought for a way around this is to use the isd_stations_search from the rnoaa package, which takes lat/lon and radius (km) as input. I can use census data from here to find population weighted lat/lon associated with a given FIPS code, and then use the lat/lon as input to isd_stations_search to get the stations associated with that FIPS code. Note that we would like to produce output similar to weather_fips, a function that takes a county code as input and then gives weather data in the surrounding area. weather_fips, except for hourly data. The weather_fips code can be forked from here.
##Cyclone Tracy
station_data <- ghcnd_stations()[[1]] # Takes a while to run
darwin_ll <- geocode("Darwin, Australia")
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Darwin,%20Australia&sensor=false
darwin <- data.frame(id = "darwin",
latitude = darwin_ll$lat,
longitude = darwin_ll$lon)
darwin_monitors <- meteo_nearby_stations(lat_lon_df = darwin,
lat_colname = "latitude",
lon_colname = "longitude",
station_data = station_data,
limit = 10,
var = c("AWDR", "AWND", "WSFG", "WSF1",
"FMTM", "MDWM", "WDF1", "WDF2",
"WDF5", "WDFG", "WDFI", "WDFM",
"WDMV", "WSF2", "WSF5", "WSFI",
"WSFM", "WT11"),
year_min = 1974, year_max = 1974)
- JF: Tapping into the GHCND, there were no stations at this time in Australia that have recorded wind speed values (of any sort). The closest station was over 2000 miles away.
keys_stations <- fips_stations("12087", date_min = "1935-08-15",
date_max = "1935-09-15")
keys_monitors <- ncdc_stations(datasetid = "GHCND", locationid = "FIPS:12087",
limit = 1000)
keys_monitors <- data.frame(id = keys_monitors$data$id,
mindate = keys_monitors$data$mindate,
maxdate = keys_monitors$data$maxdate)
keys_monitors$id <- gsub("GHCND:", "", keys_monitors$id)
keys_monitors$mindate <- as.Date(keys_monitors$mindate)
keys_monitors$maxdate <- as.Date(keys_monitors$maxdate)
keys_monitors <- subset(keys_monitors,
keys_monitors$mindate <= as.Date("1935-08-01") &
keys_monitors$maxdate >= as.Date("1935-09-01")) #still nothing
keys_monitors
## [1] id mindate maxdate
## <0 rows> (or 0-length row.names)
keys <- geocode("Florida Keys, FL")
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=Florida%20Keys,%20FL&sensor=false
keys <- data.frame(id = "keys", latitude = keys$lat, longitude = keys$lon)
keys_monitors <- meteo_nearby_stations(lat_lon_df = keys,
lat_colname = "latitude",
lon_colname = "longitude",
station_data = station_data,
limit = 10,
var = c("AWDR", "AWND", "WSFG", "WSF1",
"FMTM", "MDWM", "WDF1", "WDF2",
"WDF5", "WDFG", "WDFI", "WDFM",
"WDMV", "WSF2", "WSF5", "WSFI",
"WSFM", "WT11"),
year_min = 1935, year_max = 1935)
keys_monitors
## $keys
## id name latitude longitude distance
## 1 USC00087395 FL PUNTA GORDA 26.9333 -82.0500 265.7253
## 2 USC00080228 FL ARCADIA 27.2181 -81.8739 296.1820
## 3 USC00088786 FL TAMPA 27.9500 -82.4500 383.2446
## 4 USC00085643 FL MERRITT ISLAND 28.3500 -80.7000 435.4439
## 5 USW00012841 FL ORLANDO EXECUTIVE AP 28.5453 -81.3331 445.8657
## 6 USC00086414 FL OCALA 29.1639 -82.0778 513.2394
## 7 USC00085705 FL MIDDLEBURG 30.0603 -81.8475 612.1131
## 8 USC00087440 FL RAIFORD STATE PRISON 30.0678 -82.1928 614.2498
## 9 USC00083470 FL GLEN ST MARY 1 W 30.2717 -82.1856 636.8276
## 10 USC00085099 FL LIVE OAK 30.2889 -82.9650 648.0760
pete <- geocode("St. Petersburg, FL")
## Information from URL : http://maps.googleapis.com/maps/api/geocode/json?address=St.%20Petersburg,%20FL&sensor=false
pete <- data.frame(id = "pete", latitude = pete$lat, longitude = pete$lon)
pete_monitors <- meteo_nearby_stations(lat_lon_df = pete,
lat_colname = "latitude",
lon_colname = "longitude",
station_data = station_data,
limit = 10,
var = c("AWDR", "AWND", "WSFG", "WSF1",
"FMTM", "MDWM", "WDF1", "WDF2",
"WDF5", "WDFG", "WDFI", "WDFM",
"WDMV", "WSF2", "WSF5", "WSFI",
"WSFM", "WT11"),
year_min = 1935, year_max = 1935)
pete_monitors
## $pete
## id name latitude longitude distance
## 1 USC00088786 FL TAMPA 27.9500 -82.4500 28.06212
## 2 USC00080228 FL ARCADIA 27.2181 -81.8739 95.06357
## 3 USC00087395 FL PUNTA GORDA 26.9333 -82.0500 107.37257
## 4 USW00012841 FL ORLANDO EXECUTIVE AP 28.5453 -81.3331 154.50052
## 5 USC00086414 FL OCALA 29.1639 -82.0778 165.93144
## 6 USC00085643 FL MERRITT ISLAND 28.3500 -80.7000 200.43065
## 7 USC00087440 FL RAIFORD STATE PRISON 30.0678 -82.1928 260.96431
## 8 USC00085705 FL MIDDLEBURG 30.0603 -81.8475 267.66009
## 9 USC00083470 FL GLEN ST MARY 1 W 30.2717 -82.1856 283.46057
## 10 USC00085099 FL LIVE OAK 30.2889 -82.9650 284.01978
pete_monitors <- pete_monitors[[1]]$id
pete_monitors <- pete_monitors[1]
pete_weather <- meteo_pull_monitors(pete_monitors, date_min = "1935-08-15",
date_max = "1935-09-15",
var = c("AWDR", "AWND", "WSFG", "WSF1",
"FMTM", "MDWM", "WDF1", "WDF2",
"WDF5", "WDFG", "WDFI", "WDFM",
"WDMV", "WSF2", "WSF5", "WSFI",
"WSFM", "WT11"))
-JF: using fips_stations, was unable to find any weather station for the Florida Keys for 1935. Using meteo_nearby_stations, found the closest station to have recorded any sort of wind data to be USC00088786 in Tampa, FL. After pulling data for this station in September 1935, recieved data for wt11 only, which seems to be potentially binary where 1 indicated high or damaging winds and NA is recorded for days where such winds are not observed.
RS: Thanks to CP’s contributions above, here’s a first stab at a function putting all of this together (sadly unfinished as of 5pm 4/21 but I’ll plan to keep working on it!) The goal is to get averaged hourly data across multiple stations for a given FIPS, year, and desired weather variables.
library(stringr)
## want to aggregate all stations for a particular FIPS !
# 1. get station list for a particular fips
# probably want to use ggmaps geocodes for this instead
isd_fips_stations <- function(fips){
census_data <- read.csv('http://www2.census.gov/geo/docs/reference/cenpop2010/county/CenPop2010_Mean_CO.txt')
state <- census_data$STATEFP
county <- census_data$COUNTYFP
state[str_length(state) == 1] <- paste0(0, state[str_length(state) == 1])
county[str_length(county) == 1] <- paste0(00, county[str_length(county) == 1])
county[str_length(county) == 2] <- paste0(0, county[str_length(county) == 2])
FIPS <- paste0(state,county)
census_data$FIPS <- FIPS
lat <- census_data$LATITUDE
lon <- census_data$LONGITUDE
your_fips <- fips
row_num <- which(grepl(your_fips, census_data$FIPS))
lat_FIPS <- lat[row_num]
lon_FIPS <- lon[row_num]
stations <- isd_stations_search(lat = lat_FIPS, lon = lon_FIPS,
radius = 50)
return(stations)
}
# 2. get tidy full dataset for all monitors
# let user specify weather variables? for example, var = c("wind_speed",
# "temperature")
# function to get dataset for a single monitor
int_surface_data <- function(usaf_code, wban_code, year, var = "all"){
isd_df <- rnoaa::isd(usaf = usaf_code, wban = wban_code, year = year)$data
# add date time (suggested by one of the rnoaa package vignette examples for isd())
isd_df$date_time <- ymd_hm(sprintf("%s %s", as.character(isd_df$date), isd_df$time))
# select variables
cols <- c("usaf_station", "wban_station", "date_time", "latitude", "longitude")
subset_vars <- append(var, cols)
isd_df <- dplyr::select_(isd_df, .dots = subset_vars)
# change misisng weather data values to NA - it looks like non-signed items are filled
# with 9 (quality codes), 999 or 9999; signed items are positive filled (+9999 or +99999)
# ftp://ftp.ncdc.noaa.gov/pub/data/noaa/ish-format-document.pdf
#for(i in 1:length(var)){
# isd_df <- filter(isd_df, var[i] < 900)
#}
# great the above code failed miserably...not sure how to do this.
# also want to add a check for percent missing for each weather variable
# and add option to filter
return(isd_df)
}
# 3. pull data for multiple monitors
isd_monitors_data <- function(fips, year, var = "all"){
ids <- isd_fips_stations(fips)
safe_int <- purrr::safely(int_surface_data)
mult_stations <- lapply(int_surface_data, usaf_code = ids$usaf, wban_code =
ids$wban, year = year, var = var)
test <- mapply(safe_int, usaf_code = ids$usaf, wban_code =
ids$wban, year = year, var = var)
check_station <- sapply( )
# ^ reference meteo_pull_monitors
}
# 4. average across stations
ave_hourly <- function(all_stations){
averaged <- gather(all_stations, key, value, -)
}
RS: We should be able to filter the res dataframe to the particular month we’re interested in to get hourly wind data. We found the USAF and WBAN codes for Miami by searching this text file of stations - there should be a better way to find USAF and WBAN codes for a particular location or station.
CP: I found a function to go from location (lat/lon) to USAF and WBAN codes isd_stations_search, and use census data to go from FIPS to lat/lon. See above code.
RS: More info about this data can be found by going to NOAA’s land-based station data site, then following the link for Integrated Surface Hourly Data base (3505) at the bottom of the page. For example, the readme.txt and ish-format-document.pdf files could be helpful.